package kau.vo;

public class Course {
	private int courseId;
	private String courseName;
	private String lecturer;
	private String startDate;
	private String endDate;

	private String startTime;
	private String endTime;
	
	private double absenceGrade;
	private double earlyGrade;
	private double lateGrade;

	public Course() {}

	public Course(int courseId, String courseName, String lecturer,
			String startDate, String endDate,
			String startTime, String endTime) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		this.lecturer = lecturer;
		this.startDate = startDate;
		this.endDate = endDate;
		
		this.startTime = startTime;
		this.endTime = endTime;
	}

	public int getCourseId() {
		return courseId;
	}

	public void setCourseId(int courseId) {
		this.courseId = courseId;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getLecturer() {
		return lecturer;
	}

	public void setLecturer(String lecturer) {
		this.lecturer = lecturer;
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}


	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	
	
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(absenceGrade);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + courseId;
		result = prime * result
				+ ((courseName == null) ? 0 : courseName.hashCode());
		temp = Double.doubleToLongBits(earlyGrade);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
		result = prime * result + ((endTime == null) ? 0 : endTime.hashCode());
		temp = Double.doubleToLongBits(lateGrade);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result
				+ ((lecturer == null) ? 0 : lecturer.hashCode());
		result = prime * result
				+ ((startDate == null) ? 0 : startDate.hashCode());
		result = prime * result
				+ ((startTime == null) ? 0 : startTime.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Course other = (Course) obj;
		if (Double.doubleToLongBits(absenceGrade) != Double
				.doubleToLongBits(other.absenceGrade))
			return false;
		if (courseId != other.courseId)
			return false;
		if (courseName == null) {
			if (other.courseName != null)
				return false;
		} else if (!courseName.equals(other.courseName))
			return false;
		if (Double.doubleToLongBits(earlyGrade) != Double
				.doubleToLongBits(other.earlyGrade))
			return false;
		if (endDate == null) {
			if (other.endDate != null)
				return false;
		} else if (!endDate.equals(other.endDate))
			return false;
		if (endTime == null) {
			if (other.endTime != null)
				return false;
		} else if (!endTime.equals(other.endTime))
			return false;
		if (Double.doubleToLongBits(lateGrade) != Double
				.doubleToLongBits(other.lateGrade))
			return false;
		if (lecturer == null) {
			if (other.lecturer != null)
				return false;
		} else if (!lecturer.equals(other.lecturer))
			return false;
		if (startDate == null) {
			if (other.startDate != null)
				return false;
		} else if (!startDate.equals(other.startDate))
			return false;
		if (startTime == null) {
			if (other.startTime != null)
				return false;
		} else if (!startTime.equals(other.startTime))
			return false;
		return true;
	}

	

	@Override
	public String toString() {
		return "Course [courseId=" + courseId + ", courseName=" + courseName
				+ ", lecturer=" + lecturer + ", startDate=" + startDate
				+ ", endDate=" + endDate + ", startTime=" + startTime
				+ ", endTime=" + endTime + ", absenceGrade=" + absenceGrade
				+ ", earlyGrade=" + earlyGrade + ", lateGrade=" + lateGrade
				+ "]";
	}

	public double getAbsenceGrade() {
		return absenceGrade;
	}

	public void setAbsenceGrade(double absenceGrade) {
		this.absenceGrade = absenceGrade;
	}

	public double getEarlyGrade() {
		return earlyGrade;
	}

	public void setEarlyGrade(double earlyGrade) {
		this.earlyGrade = earlyGrade;
	}

	public double getLateGrade() {
		return lateGrade;
	}

	public void setLateGrade(double lateGrade) {
		this.lateGrade = lateGrade;
	}

	public Course(int courseId, String courseName, String lecturer,
			String startDate, String endDate, String startTime, String endTime,
			double absenceGrade, double earlyGrade, double lateGrade) {
		super();
		this.courseId = courseId;
		this.courseName = courseName;
		this.lecturer = lecturer;
		this.startDate = startDate;
		this.endDate = endDate;
		this.startTime = startTime;
		this.endTime = endTime;
		this.absenceGrade = absenceGrade;
		this.earlyGrade = earlyGrade;
		this.lateGrade = lateGrade;
	}

	
		
}
